import {debounce} from "./utils";
import BackTop from "components/content/backTop/BackTop";
export const itemListenerMixin = {
  mounted() {
    // 1.图片加载完成的事件监听
    const refresh = debounce(this.$refs.scroll.refresh, 50)
    this.$bus.$on('itemImageLoad', () =>  {
      refresh()
    })
  },
}

export const backTopMixin = {
  components: {
    BackTop
  },
  data() {
    return {
      isShowBackTop: false,
    }
  },
  methods: {
    backClick() {
      this.$refs.scroll.scroll.scrollTo(0,0,500)
    }
  }
}
